package com.zhixiang.core.util;

public class String2Array
{
    /**
     * 
     * Description: String字符串转Internet数组,按","分割
     * @return 
     * @see
     */
    public static Integer[] stringToIntegerArray(String ids){
        String[] arrs = ids.split(",");
        Integer[] ints = new Integer[arrs.length];
        for(int i=0;i<arrs.length;i++){
            ints[i] = Integer.parseInt(arrs[i]);
        }
        return ints;
    }
    
    /**
     * 
     * Description:String数组转Integer数组
     * @param arrs 需要转换的 String[]
     * @return 
     * @see
     */
    public static Integer[] stringArrayToIntegerArray(String[] arrs){
        Integer[] ints = new Integer[arrs.length];
        for(int i=0;i<arrs.length;i++){
            ints[i] = Integer.parseInt(arrs[i]);
        }
        return ints;
    }
    /**
     * 
     * Description:按","分割
     * @param arrs 需要转换的 String
     * @return 
     * @see
     */
    public static Long[] stringToLongArray(String ids){
        String[] arrs = ids.split(",");
        Long[] longs = new Long[arrs.length];
        for(int i=0;i<arrs.length;i++){
            longs[i] = Long.parseLong(arrs[i]);
        }
        return longs;
    }
    
    /**
     * 
     * Description:String数组转Long数组
     * @param arrs 需要转换的 String[]
     * @return 
     * @see
     */
    public static Long[] stringArrayToLongArray(String[] arrs){
        Long[] longs = new Long[arrs.length];
        for(int i=0;i<arrs.length;i++){
            longs[i] = Long.parseLong(arrs[i]);
        }
        return longs;
    }
}
